package JaggSoft.Utilidades;

import java.awt.Component;
import javax.swing.*;
import javax.swing.table.TableCellRenderer;

public class MyRendidorComboBox extends JComboBox implements TableCellRenderer {
    public MyRendidorComboBox(Object[] items) {
        super(items);
    }
    @Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        if(isSelected){
            this.setForeground(table.getSelectionForeground());
            super.setBackground(table.getSelectionBackground());
        }
        else{
            this.setForeground(table.getForeground());
            this.setBackground(table.getBackground());
        }
        this.setSelectedItem(value);
        return this;
    }
}